/**********************************************************************************************************************
 * Copyright (c) Prophesee S.A.                                                                                       *
 *                                                                                                                    *
 * Licensed under the Apache License, Version 2.0 (the "License");                                                    *
 * you may not use this file except in compliance with the License.                                                   *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0                                 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed   *
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.                      *
 * See the License for the specific language governing permissions and limitations under the License.                 *
 **********************************************************************************************************************/

// ISSD sequences generated by psee_issd_convert.
// Parameters:
// issd_csv_format_version=1.0
// system=evk3_gen31_cd
// operator=Prophesee
// dry_run=False
// no_system=False
// strip_prefix=True
// sensor_version=None
// args=
// sensor=PseeEvk3Gen31
// date=2021-09-14T12:36:39
// psee_issd_version=1.1.3.215+g40ab73918.d20210008
// psee_sensor_lib_version=3.3.0.486+g1106e0921.d20210015
// issd_data_format_version=1.0

// clang-format off

#ifndef METAVISION_HAL_GEN31_EVK3_ISSD_H
#define METAVISION_HAL_GEN31_EVK3_ISSD_H

#include <vector>

namespace Metavision {

static const std::vector<RegisterOperation> gen31_evk3_init = {
    RegisterOperation::Read(0x00000800, 0x00000028, 0x000000FF),
    RegisterOperation::Read(0x00000800, 0x00000028, 0x000000FF),
    RegisterOperation::Read(0x00000800, 0x00000028, 0x000000FF),
    RegisterOperation::Write(0x00000000, 0x00000000),
    RegisterOperation::Write(0x0000000C, 0x00000000),
    RegisterOperation::Write(0x0000000C, 0x00000001),
    RegisterOperation::Write(0x00000000, 0x00000000),
    RegisterOperation::Write(0x00000000, 0x00000000),
    RegisterOperation::Write(0x00000000, 0x00000008),
    RegisterOperation::Write(0x00000000, 0x0000000A),
    RegisterOperation::Write(0x00000000, 0x0000000E),
    RegisterOperation::Write(0x00000000, 0x00000006),
    RegisterOperation::Write(0x00000000, 0x00001006),
    RegisterOperation::Write(0x00000768, 0x08010000),
    RegisterOperation::Write(0x0000076C, 0x00000000),
    RegisterOperation::Write(0x00000770, 0x00000000),
    RegisterOperation::Write(0x00000774, 0x00000000),
    RegisterOperation::Write(0x00000778, 0x00000000),
    RegisterOperation::Write(0x0000077C, 0x00000000),
    RegisterOperation::Write(0x00000798, 0x003FFFFF),
    RegisterOperation::Write(0x00000764, 0x00FFFFFF),
    RegisterOperation::Write(0x00000008, 0x00000100),
    RegisterOperation::Write(0x00001500, 0x0000000D),
    RegisterOperation::Write(0x00000000, 0x00001106),
    RegisterOperation::Write(0x00000000, 0x00001106),
    RegisterOperation::Write(0x0000074C, 0x00000002),
    RegisterOperation::Write(0x00001508, 0x00000FA0),
    RegisterOperation::Write(0x00001520, 0x00003E80),
    RegisterOperation::Write(0x0000150C, 0x000001F8),
    RegisterOperation::Write(0x00001510, 0x00002000),
    RegisterOperation::Write(0x00000238, 0x00000001),
    RegisterOperation::Write(0x00000204, 0x0000000B),
    RegisterOperation::Write(0x0000021C, 0x00000100),
    RegisterOperation::Write(0x00000200, 0x00000010),
    RegisterOperation::Write(0x00000200, 0x00000018),
    RegisterOperation::Write(0x00000200, 0x0000001A),
    RegisterOperation::Read(0x00000218, 0x90200C02, 0xFFFFFFFF),
    RegisterOperation::Write(0x00000240, 0x00140501),
    RegisterOperation::Write(0x00000208, 0x40020BFF),
    RegisterOperation::Write(0x00000208, 0x40020BFF),
    RegisterOperation::Write(0x00000208, 0x400203FF),
    RegisterOperation::Write(0x00000244, 0x400203FF),
    RegisterOperation::Write(0x00000244, 0x400203FF),
    RegisterOperation::Write(0x00000244, 0x400203FF),
    RegisterOperation::Write(0x0000021C, 0x10000100),
    RegisterOperation::Write(0x0000021C, 0x10000101),
    RegisterOperation::Write(0x00000300, 0x5903E1B0),
    RegisterOperation::Write(0x00000304, 0x5903E1B0),
    RegisterOperation::Write(0x00000308, 0x5900629B),
    RegisterOperation::Write(0x0000030C, 0x59001BA9),
    RegisterOperation::Write(0x00000310, 0x59014D8C),
    RegisterOperation::Write(0x00000314, 0x790DB770),
    RegisterOperation::Write(0x00000318, 0x59014D8C),
    RegisterOperation::Write(0x0000031C, 0x59014DBE),
    RegisterOperation::Write(0x00000320, 0x79002C3E),
    RegisterOperation::Write(0x00000324, 0x79005436),
    RegisterOperation::Write(0x00000328, 0x59166CB7),
    RegisterOperation::Write(0x0000032C, 0x79000000),
    RegisterOperation::Write(0x00000330, 0x590000FF),
    RegisterOperation::Write(0x00000334, 0x7100002A),
    RegisterOperation::Write(0x00000338, 0x7100002F),
    RegisterOperation::Write(0x0000033C, 0x71000021),
    RegisterOperation::Write(0x00000340, 0x590004FF),
    RegisterOperation::Write(0x00000344, 0x590000FF),
    RegisterOperation::Write(0x00000348, 0x59014DFF),
    RegisterOperation::Write(0x0000034C, 0x7900571E),
    RegisterOperation::Write(0x00000350, 0x79125C35),
    RegisterOperation::Write(0x00000354, 0x7902CE29),
    RegisterOperation::Write(0x00000358, 0x71003DD6),
    RegisterOperation::Write(0x0000035C, 0x51034FB1),
    RegisterOperation::Write(0x00000360, 0x51004FD4),
    RegisterOperation::Write(0x00000364, 0x510006D4),
    RegisterOperation::Write(0x00000368, 0x71000054),
    RegisterOperation::Write(0x00000238, 0x00000001),
    RegisterOperation::Write(0x00000220, 0x00000001),
    RegisterOperation::Write(0x00000204, 0x00000003),
    RegisterOperation::Write(0x00000204, 0x00000003),
    RegisterOperation::Write(0x00000450, 0x00000000),
    RegisterOperation::Write(0x0000053C, 0x00000000),
    RegisterOperation::Write(0x00000204, 0x00000023),
    RegisterOperation::Write(0x0000024C, 0x0002BFFF),
    RegisterOperation::Write(0x00000248, 0x000000C9)
};

static const std::vector<RegisterOperation> gen31_evk3_start = {
    RegisterOperation::WriteField(0x00000000, 0x00001107, 0x1),
    RegisterOperation::WriteField(0x00000000, 0x00041107, 0x40000),
    RegisterOperation::WriteField(0x00000000, 0x000C1107, 0x80000),
    RegisterOperation::Write(0x00000008, 0x00000300),
    RegisterOperation::Write(0x00000238, 0x00000001),
    RegisterOperation::Write(0x00000204, 0x0000002B),
    RegisterOperation::Delay(250000),
    RegisterOperation::Write(0x00000248, 0x000000C8)
};

static const std::vector<RegisterOperation> gen31_evk3_stop = {
    RegisterOperation::Write(0x00000204, 0x00000023),
    RegisterOperation::Write(0x00000238, 0x00000000),
    RegisterOperation::Write(0x00000008, 0x00000100),
    RegisterOperation::WriteField(0x00000000, 0x00081107, 0x40000),
    RegisterOperation::WriteField(0x00000000, 0x00081106, 0x1)
};

static const std::vector<RegisterOperation> gen31_evk3_destroy = {
    RegisterOperation::Write(0x00000238, 0x00000000),
    RegisterOperation::Write(0x0000074C, 0x00000000),
    RegisterOperation::Write(0x00000000, 0x0008110E),
    RegisterOperation::Write(0x00000000, 0x0008110C),
    RegisterOperation::Write(0x00000000, 0x00081108),
    RegisterOperation::Write(0x0000000C, 0x00000000),
    RegisterOperation::Write(0x0000000C, 0x00000001)
};

static Issd gen31_evk3_sequence = Issd{
    gen31_evk3_init,
    gen31_evk3_start,
    gen31_evk3_stop,
    gen31_evk3_destroy,
};

} // namespace Metavision

#endif // METAVISION_HAL_GEN31_EVK3_ISSD_H

// clang-format on
